package toman.jpa;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p/>
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: Apr 6, 2010
 * Time: 7:03:52 PM
 */
@Entity
public class Album implements Serializable {

    @Id
    private String name;
    @Temporal(TemporalType.DATE)
    @Column(name = "ALBUMCREATED")
    private Date created;
    @OneToMany(mappedBy = "album", fetch = FetchType.LAZY)
    private List<Photo> photos = new ArrayList<Photo>();

    public List<Photo> getPhotos() {
        return photos;
    }

    public void setPhotos(List<Photo> photos) {
        this.photos = photos;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }
}
